package cn.smart.epic.core.shiro.check;

import cn.smart.epic.core.util.SpringContextHolder;

/**
 * @Auther Z.B
 * @date 2017/10/13 13:55
 * @Email 2545375@qq.com
 * @Description 权限检查工厂
 * @since 1.0
 */

public class PermissionCheckManager {

    private static final PermissionCheckManager me = new PermissionCheckManager();

    private ICheck defaultCheckFactory = SpringContextHolder.getBean(ICheck.class);

    public static PermissionCheckManager me() {
        return me;
    }

    private PermissionCheckManager() {

    }

    public static boolean check(Object[] permissions) {
        return me.defaultCheckFactory.check(permissions);
    }

    public static boolean checkAll() {
        return me.defaultCheckFactory.checkAll();
    }
}
